# Maintainer: Alexey Pavlov <alexpux@gmail.com>

_realname=libuv

pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver=0.11.25
pkgrel=1
pkgdesc="A new platform layer for Node.JS (mingw-w64)"
arch=('any')
url="https://github.com/joyent/libuv"
license=("custom")
makedepends=("${MINGW_PACKAGE_PREFIX}-gcc")
depends=("${MINGW_PACKAGE_PREFIX}-gcc-libs")
options=('staticlibs' 'strip')
source=("https://github.com/joyent/libuv/archive/v$pkgver.tar.gz")
md5sums=('615b5dd8a4763a848bc3f50513d9fd23')

prepare() {
  cd "$srcdir/${_realname}-$pkgver"
  ./autogen.sh
}

build() {
  mkdir -p "${srcdir}/build-${MINGW_CHOST}"
  cd "${srcdir}/build-${MINGW_CHOST}"
  "${srcdir}"/${_realname}-${pkgver}/configure \
    --prefix=${MINGW_PREFIX} \
    --build=${MINGW_CHOST} \
    --host=${MINGW_CHOST}
  make
}

package() {
  cd "${srcdir}/build-${MINGW_CHOST}"
  make DESTDIR="$pkgdir" install
}
